<template>
	<view class="table">
		<view class="table_header">
			<view> 货号 </view>
			<view> 数量 </view>
			<view> 单价 </view>
			<view> 金额 </view>
			<view> 备注 </view>
		</view>
		<view @longpress="edit(index)" class="table_body" v-for="(item, index) in data" :key="index">
			<view> {{ item ? item.proId : "-" }} </view>
			<view> {{ item ? item.orderNum : "0" }} </view>
			<view> {{ item ? item.realPrice : "0" | unifyNumber}} </view>
			<view>
				{{ parseInt(item.orderNum) * parseInt(item.realPrice) ? (+item.orderNum) * (+item.realPrice) : "0" | unifyNumber}}
			</view>
			<view> {{ item.remark ? item.remark : "-" }} </view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {};
		},
		props: ["data", "proType","type"],
		methods: {
			edit(index) {
				if(this.type == 0 ){

					return
				}
				uni.navigateTo({
					url: `/pages/newOrder/editItem?index=${index}&proType=${this.proType}`
				})
			},
		},
		onShow(){
			console.log(uni.getStorageSync("ShipmentList"))
			console.log(uni.getStorageSync("returnList"))
		}
	};
</script>

<style lang="scss" scoped>
	.table {
		min-height: 300rpx;

		.table_header,
		.table_body {
			display: grid;
			text-align: center;
			grid-template-columns: repeat(5, 1fr);
			border-bottom: 1px solid #bdbdbd;
		}

		.table_header {
			font-size: 30rpx;
			border-bottom: 1px solid #bdbdbd;

			view {
				height: 80rpx;
				line-height: 80rpx;
			}
		}

		.table_body {
			view {
				height: 60rpx;
				line-height: 60rpx;
				max-width: 150rpx;
				overflow: auto;
				// background-color: #fac;
				// border-left: 1px solid #eee;
				// border-bottom: 1px solid #eee;
				// border-right: 1px solid #eee;
			}
		}
	}
</style>
